﻿//-----------------------------------------------------------------------
// <copyright file="DefaultProjectsManager.cs" author="Artak Mkrtchyan">
//     Creative Commons - GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/
// </copyright>
// <author>Artak Mkrtchyan</author>
// <email>mkArtak@gmail.com</email>
// <date>02/05/2013</date>
//-----------------------------------------------------------------------

using ConsoleHoster.Common.Model;
using ConsoleHoster.Common.Utilities;
using ConsoleHoster.Common.Utilities.Threading;
using ConsoleHoster.View.Popups;
using ConsoleHoster.ViewModel;

namespace ConsoleHoster.Model
{
	public class DefaultProjectsManager : GenericSettingsProvider<ProjectsListEditor, ProjectsListViewModel, ProjectsListViewModel>, IProjectsManager
	{
		public DefaultProjectsManager(IDispatcher argDispatcher, ViewSettings argViewSettings, ILogger argLogger)
			: base(argDispatcher, argViewSettings, new ComponentLogger("DefaultProjectsManager", argLogger))
		{
		}

		protected override ProjectsListEditor CreateView(ProjectsListViewModel argCurrentState)
		{
			return new ProjectsListEditor(argCurrentState, this.Dispatcher, this.Logger);
		}

		protected override ProjectsListViewModel RetrieveDataFromView()
		{
			return this.view.ViewModel;
		}
	}
}
